﻿using System;
using System.Collections.Generic;
using Citi.PTSConsolidation.SchedulerUI.Bases;
using Citi.RoutineBase;
using System.IO;
using System.Configuration;

namespace Citi.PTSConsolidation.SchedulerUI
{
    internal class SystemMonthlyVarianceReportGeneration : MonthlyReportGeneration
    {
        private static string PtsReportSavePath { get { return ConfigurationManager.AppSettings["PtsReportSavePath"]; } }

        internal override List<string> ColumnsToMerge { get { return new List<string> { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J" }; } }
        internal override List<string> ColumnsToDate { get { return new List<string> { "K", "L", "N", "P", "R", "T" }; } }
        //internal override string ReportPath { get; set; }
        internal override string ReportName { get { return "MonthlySystemVariance"; } }
        internal override string TemplatePath { get { return ConfigurationManager.AppSettings["TemplateExcelPtsSystemMonthly"]; } }
        //internal override string FriendlyName { get; set; }
        internal override string MonthlyReportWithConnections { get { return ConfigurationManager.AppSettings["SystemMonthlyPartial"]; } }

        public void GenerateReport(string yearReportName, int year, DateTime referenceDate, ref ICurrentAction currentAction)
        {
            FriendlyName = string.Format("PTS Monthly System Veariance Report ({0})", yearReportName);
            ReportPath = Path.Combine(PtsReportSavePath, "Monthly System Variance", year.ToString());
            GenerateReport(referenceDate, year, ref currentAction);
        }
    }

    public class SystemMonthlyVariancePreviousYearReportGeneration : ReportPreviousYear, IExecutableRoutine
    {
        protected override void ExecuteProcess(DateTime referenceDate, ref ICurrentAction currentAction, string networkUser, string networkPassword, Dictionary<string, object> parameters)
        {
            new SystemMonthlyVarianceReportGeneration().GenerateReport("Previous Year", referenceDate.Year - 1, referenceDate, ref currentAction);
        }
    }

    public class SystemMonthlyVarianceCurrentYearReportGeneration : ReportCurrentYear
    {
        protected override void ExecuteProcess(DateTime referenceDate, ref ICurrentAction currentAction, string networkUser, string networkPassword, Dictionary<string, object> parameters)
        {
            new SystemMonthlyVarianceReportGeneration().GenerateReport("Current Year", referenceDate.Year, referenceDate, ref currentAction);
        }
    }

    public class SystemMonthlyVarianceNextYearReportGeneration : ReportNextYear, IExecutableRoutine
    {
        protected override void ExecuteProcess(DateTime referenceDate, ref ICurrentAction currentAction, string networkUser, string networkPassword, Dictionary<string, object> parameters)
        {
            new SystemMonthlyVarianceReportGeneration().GenerateReport("Next Year", referenceDate.Year + 1, referenceDate, ref currentAction);
        }
    }
    //public class SystemMonthlyVariancePreviousYearReportGeneration : ReportPreviousYear, IExecutableRoutine
    //{
    //    protected override void ExecuteProcess(DateTime referenceDate, ref ICurrentAction currentAction, string networkUser, string networkPassword, Dictionary<string, object> parameters)
    //    {
    //        ReportGenerationHelper.GenerateSystemMonthlyVarianceReportYear(referenceDate.Year - 1, referenceDate, ref currentAction, parameters, "Previous Year");
    //    }
    //}

    //public class SystemMonthlyVarianceCurrentYearReportGeneration : ReportCurrentYear
    //{
    //    protected override void ExecuteProcess(DateTime referenceDate, ref ICurrentAction currentAction, string networkUser, string networkPassword, Dictionary<string, object> parameters)
    //    {
    //        ReportGenerationHelper.GenerateSystemMonthlyVarianceReportYear(referenceDate.Year, referenceDate, ref currentAction, parameters, "Current Year");
    //    }
    //}

    //public class SystemMonthlyVarianceNextYearReportGeneration : ReportNextYear, IExecutableRoutine
    //{
    //    protected override void ExecuteProcess(DateTime referenceDate, ref ICurrentAction currentAction, string networkUser, string networkPassword, Dictionary<string, object> parameters)
    //    {
    //        ReportGenerationHelper.GenerateSystemMonthlyVarianceReportYear(referenceDate.Year + 1, referenceDate, ref currentAction, parameters, "Next Year");
    //    }
    //}
}